1. Field of the Invention
The present invention relates generally to software objects, and in particular, to a method, apparatus, and article of manufacture for dynamically extending the properties of a software object and the ability to manipulate such properties through a user interface control.
2. Description of the Related Art
Software objects are frequently used by applications to represent collections of properties that can be modified by the user. For example, in a drawing application, a software object may be a circle having a radius, color, etc. Normally, the collection of properties of the object is fixed. In other words, when an application defines the class for the object, the collection of properties is fixed at compile time.
The prior art may support the use of properties created at runtime (referred to as dynamic properties). Such dynamic properties are not stored with the object itself and when the application that defines the properties is unloaded, or terminated, the runtime properties may be discarded. Further, dynamic properties are on a class-wide or object wide basis and do not vary between objects of the same type. For example, the same dynamic properties would apply to each instance of an object and different instances cannot have different dynamic properties. However, it may be desirable to vary dynamic object properties on a per-instance basis such that different object instances of the same type have a different collection of properties.
An example of a dynamic property would be if an object in a drawing program is a circle. An application may desire to dynamically extend the properties of the circle object such that the circle object represents a manhole cover having a manufacturer and weight property. The prior art would permit all circle objects to be dynamically extended such that each circle object instance represents a manhole cover with these properties. Also suppose that another application desires to dynamically extend the circle object such that the circle object represents a round table having a height and a number of table extensions. The prior art would not permit both the first application and second application to extend different instances of the same circle object such that one instance represents a manhole cover and the other instance represents a round table (i.e., with the different instances having different properties). Thus, it would be desirable to allow dynamic properties on a per-instance basis.
In addition to the above, applications typically present the properties of one or more objects to the user in a graphical user interface. Such a graphical user interface may consist of a window or dialog box. Each dialog box is usually implemented to display the properties of just a few kinds of objects, with dialog controls (buttons, text fields, etc.) specific to the kind of data those objects contain. In this regard, a user interface may base the dialog control that is used on the type of object. For example, a boolean property may be displayed using a radio button dialog control, and a numerical value may be displayed using a text entry box dialog control.
In certain circumstances, the default selection of a dialog control may not be the most desirable or appropriate control to use to display the property. For example, a property may be a temperature value with a double precision number. The prior art would likely provide a default text field for adjusting the temperature value. However, it may be more desirable to use a slider to adjust the value of the temperature where the slider has minimum and maximum values. Accordingly, it would be desirable to allow an object to specify the dialog control that is used to display a particular property of the object.